import request from '@/utils/request'

// 查询拼团列表
export function getGroupList(query) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/selectByConditionsPage',
    method: 'get',
    params: query
  })
}

// 添加拼团
// 获取活动标签不分页
export function getLabelList(query) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroupLabel/list',
    method: 'get',
    params: query
  })
}

// 根据机构id查询课程列表
export function getCourseList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/listByBusiness',
    method: 'get',
    params: query
  })
}

// 根据课程编号查询套餐
export function getMealList(query) {
  return request({
    url: '/jbl-course/api/merchant/v1/course/setmeal/getByCourseId',
    method: 'get',
    params: query
  })
}

// 新增拼团
export function addNewGroup(data) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/add',
    method: 'post',
    data
  })
}

// 上下架拼团活动
export function upOrDownGroupList(data) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/updateById',
    method: 'post',
    data
  })
}

// 删除拼团活动
export function delGroupList(query) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/deleteById',
    method: 'get',
    params: query
  })
}

// 查询拼团详情
export function checkGroupList(query) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/getById',
    method: 'get',
    params: query
  })
}

// 修改拼团信息
export function editGroupList(data) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/updateGroupUpdate',
    method: 'post',
    data
  })
}

// 统计图标
export function getDataInfo(query) {
  return request({
    url: '/jbl-activity-group/api/merchant/v1/activityGroup/getStatistics',
    method: 'get',
    params: query
  })
}

// 生成二维码分享
export function QRcode(query) {
  return request({
    url: '/jbl-activity-group/api/mobile/v1/activityGroup/QRcode',
    method: 'get',
    params: query
  })
}
